Install-sqmOlaMaintenanceSolution
Configuration
sqmSQLTool v1.8.2+ · Installation
✓ -WhatIf supported 🛠 Pipeline
Execution order: 1. CommandExecute.sql 2. CommandLog.sql 3. DatabaseBackup.sql 4. DatabaseIntegrityCheck.sql 5. IndexOptimize.sql
Note: This function creates only the objects (stored procedures and tables), not the SQL Agent jobs. Jobs are created separately using dedicated functions (e.g.,
New-sqmOlaBackupJobs).
Parameters
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| -SqlInstance | string[] | Optional | $env:COMPUTERNAME | One or more instances. Pipeline-capable. |
| -SqlCredential | PSCredential | Optional | — | Credentials for all SQL connections. |
| -SourcePath | string | Optional | GitHub ZIP URL | Alternative source for the ZIP archive. |
| -Force | switch | Switch | $false | Overwrite existing installation. |
| -Update | switch | Switch | $false | Alias for -Force (update mode). |
| -ContinueOnError | switch | Switch | $false | Continue to next instance on error. |
| -EnableException | switch | Switch | $false | Re-throw exceptions instead of collecting results. |
| -WhatIf / -Confirm | switch | Optional | — | ShouldProcess (ConfirmImpact: None) guards the installation step. |
Examples
Install Ola Maintenance Solution on SQL01
Install-sqmOlaMaintenanceSolution -SqlInstance "SQL01"
Reinstall (update) existing Ola installation
Install-sqmOlaMaintenanceSolution -SqlInstance "SQL01" -Force
Install on multiple instances via pipeline, continue on error
"SQL01","SQL02","SQL03" | Install-sqmOlaMaintenanceSolution -ContinueOnError